<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="Public:meta" />
</head>
<body id="main_page">
<include file="Public:position" />
<div class="container">
    <eq name="HasConfig" value="1">
        <div class="box">
            <form enctype="multipart/form-data" action="{$Action}" method="post" id="frmSave">
                <volist name="Group" id="g">
                    <div class="box-header"><h4>{$g.DisplayName}</h4></div>
                    <div class="box-content">
                        <table class="boxtable">
                            <volist name="Attribute" id="a">
                                <eq name="a.GroupID" value="$g.AttributeID">
                                        <tr>
                                            <th class="w120">{$a.DisplayName}</th>
                                            <td>{$a.html}</td>
                                        </tr>
                                </eq>
                            </volist>
                        </table>
                    </div>
                </volist>               
                <div class="box-footer">
                    <div class="box-footer-inner">
                        <input id="btnSubmit" class="marginright" type="submit" value="保存"   {$DisableText} />
                        <eq name="IsWritable" value="0"><b style="color:red;">当前模板配置文件config.xml只读，不能修改</b></eq>
                    </div>
                </div>
            </form>
        </div>
        
     <else/>
          <div style="color:red; padding:10px; font-weight:bold">暂无模板配置，如需要，请在模板目录建立模板配置文件config.xml</div>
    </eq>
</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
	function complete(data){
		CloseLoadBox();
		if (data.status==1){
			SucceedBox(data.info);
		}else if(data.status==0){
			ErrorBox(data.info);
		}else if(data.status==2){
			ErrorBox(data.info); //上传失败
		}else if(data.status==3){
			$('#'+data.data.ImageField).val(data.data.Path);
			SucceedBox(data.info); //上传成功
		}
	};
	 
	 $('#btnSubmit').click(function(){
		$('#frmSave').attr('action','{$Action}');
	 });
	 
	 $('#frmSave').submit(function(){
			try{
				LoadBox();
				for ( s in CKEDITOR.instances ){
				   CKEDITOR.instances[s].updateElement();
				}
			}catch(e){
				;
			}finally{
				$(this).ajaxSubmit( {success: complete,dataType: 'json'} );
				return false;  //为了防止普通浏览器进行表单提交和产生页面导航（防止页面刷新？）返）返回false  
			}
	 });
	 
	<eq name="IsWritable" value="0">
			$(".boxtable input,.boxtable select,.boxtable textarea,").attr("disabled","disabled");
	</eq>
});
</script>